home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
misc
/
amag
/
am9305b.lha
/
Tips & Tricks
/
font.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-23
|
933b
|
44 lines
/* Aufruf vom CLI: CheckFont <fontname>
* z.B. CheckFont fonts:Lettergothic.font */
#include <exec/types.h>
#include <dos/dos.h>
#include <diskfont/diskfont.h>
void CheckFont(char *fontname)
{
BPTR FontFile;
UWORD fch_FileID;
if (FontFile=Open(fontname,MODE_OLDFILE))
{
if (Read(FontFile,&fch_FileID,2)==2)
{
/* OFCH_ID hat den Wert 0x0f03. Definiert ist
* dieser in diskfont/diskfont.h.
* OFCH = Outline-Font-Contents-Header
*/
if (fch_FileID==OFCH_ID)
{
/* Font ist ein Outline-Font */
printf("%s ist ein Outline-Font\n",fontname);
}
else
{
/* Font ist kein Outline-Font */
printf("%s ist kein Outline-Font\n",fontname);
}
}
Close(FontFile);
} else printf("Font %s existiert nicht\n",fontname);
}
main(long argc,char **argv)
{
if( argc == 2 )
{
/* Nur von CLI */
CheckFont(argv[1]);
}
}